import request from '@/utils/request'
import qs from 'qs'

export function findListByPage(param) {
  return request({
    url: 'api/scriptPack/scanResult',
    method: 'get',
    param
  })
}


export function findById(id) {
  return request({
    url: 'api/scriptPack/scanResult' + '/' + id,
    method: 'get',
    id
  })
}

export function add(data) {
  return request({
    url: 'api/scriptPack/scanResult',
    method: 'post',
    data
  })
}

export function edit(data) {
  return request({
    url: 'api/scriptPack/scanResult',
    method: 'put',
    data
  })
}

export function ignoreById(scanListId, id) {
  return request({
    url: 'api/scriptPack/scanResult' + '/' + scanListId + '/' + id,
    method: 'put',
    scanListId, id
  })
}

export function del(id) {
  return request({
    url: 'api/scriptPack/scanResult'  + '/' + id,
    method: 'delete',
    id
  })
}

export function download(params) {
  return request({
    url: 'api/scriptPack/scanResult/download' + '?' + qs.stringify(params, { indices: false }),
    method: 'get',
    responseType: 'blob'
  })
}

export default {
  findListByPage,
  findById,
  edit,
  ignoreById,
  add,
  del,
  download
}
